/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainFrame.java
 *
 * Created on 2011-9-17, 22:21:14
 */
package com.football.lottery.ui;

import com.football.lottery.services.DAOServices;
import javax.swing.JFrame;

/**
 *
 * @author JingWen
 */
public class MainFrame extends JFrame
{
  private ImportPanel importPanel;
  private HistoryPanel historyPanel;
  private AnalysisPanel analysisPanel;
  private DAOServices fblServices;

  /** Creates new form MainFrame */
  public MainFrame()
  {
    initComponents();
    myInit();
  }
  
  public DAOServices getFblServices()
  {
    return fblServices;
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabPane = new javax.swing.JTabbedPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(600, 500));

        tabPane.setMinimumSize(new java.awt.Dimension(800, 500));
        tabPane.setPreferredSize(new java.awt.Dimension(1100, 500));
        getContentPane().add(tabPane, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTabbedPane tabPane;
    // End of variables declaration//GEN-END:variables

  
  private void myInit()
  {
    this.setTitle("JSUT DO IT");
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    importPanel = new ImportPanel(this);
    historyPanel = new HistoryPanel(this);
    analysisPanel = new AnalysisPanel(this);

    this.tabPane.add("History", historyPanel);
    this.tabPane.add("Analysis", analysisPanel);
    this.tabPane.add("Import", importPanel);
    
    fblServices = new DAOServices();
    historyPanel.refreshUI();
    historyPanel.addComboBoxListener();
  }
  
  public AnalysisPanel getAnalysisPanel()
  {
    return analysisPanel;
  }

  public HistoryPanel getHistoryPanel()
  {
    return historyPanel;
  }

  public ImportPanel getImportPanel()
  {
    return importPanel;
  }
}
